package com.hd.trans.network;


import com.hd.trans.network.annotation.FileName;
import com.hd.trans.network.annotation.Get;
import com.hd.trans.network.annotation.KeyExtension;
import com.hd.trans.network.annotation.Param;
import com.hd.trans.network.annotation.Set;

/**
 * Author:  yang
 * Date:  2020-01-18 22:14
 * Desc:  翻译相关数据保存
 */
@FileName("preference.translate.v2")
public interface TranslatePreference {

    /**
     * 语音翻译已使用次数(每日)
     */
    String VOICE_USED_COUNT = "voice_used_count";

    /**
     * 文本翻译已使用次数(每日)
     */
    String TEXT_USED_COUNT = "text_used_count";

    /**
     * 拍照翻译已使用次数(每日)
     */
    String PHOTO_USED_COUNT = "photo_used_count";

    /**
     * 强制收银台是否已显示
     */
    String CASHIER_FORCED_SHOWED = "cashier_forced_showed";

    /**
     * 强制收银台显示后，翻译的次数
     */
    String TRANSLATE_AFTER_CASHIER_COUNT = "translate_after_cashier_count";


    /**
     * 阿里Token
     */
    String ALI_TOKEN = "ali_token";

    /**
     * 语音播放速度
     */
    String VOICE_SPEED = "voice_speed";

    /**
     * 语音播放次数
     */
    String VOICE_TIMES = "voice_times";

    /**
     * 语音播放男/女声
     */
    String VOICE_GENDER = "voice_gender";

    /**
     * 外语语音播放人声
     */
    String VOICE_FL_TAG = "voice_fl_tag";
    /**
     * 中文语音播放人声
     */
    String VOICE_CN_TAG = "voice_CN_tag";
    /**
     * 翻译完成自动语音播放
     */
    String VOICE_AUTO = "voice_auto";
    /**
     * 外语语音播放人声索引
     */
    String VOICE_FL_TAG_INDEX = "voice_fl_tag_index";
    /**
     * 中文语音播放人声索引
     */
    String VOICE_CN_TAG_INDEX = "voice_CN_tag_index";

    /**
     * 文本翻译目标语言
     */
    String TRANS_TO_LANGUAGE = "trans_to_language";

    /**
     * 文本翻译源语言
     */
    String TRANS_FROM_LANGUAGE = "trans_from_language";

    /**
     * 拍照翻译源语言
     */
    String FILE_TO_LANGUAGE = "file_to_language";

    /**
     * 拍照翻译源语言
     */
    String FILE_FROM_LANGUAGE = "file_from_language";
    /**
     * 语音翻译目标语言
     */
    String VOICE_TO_LANGUAGE = "voice_to_language";

    /**
     * 语音翻译源语言
     */
    String VOICE_FROM_LANGUAGE = "voice_from_language";

    /**
     * 取词翻译识别源语言
     */
    String WORD_TRANS_FROM_LANGUAGE = "word_trans_from_language";

    /**
     * 取词翻译识别目标语言
     */
    String WORD_TRANS_TO_LANGUAGE = "word_trans_to_language";

    /**
     * 取词翻译识别语言码
     */
    String WORD_TRANS_CODE = "word_trans_code";

    /**
     * 默认值
     */
    class Default {

        /**
         * 语音播放速度(1-15)
         */
        static final int VOICE_SPEED = 5;
        /**
         * 语音播放次数
         */
        static final int VOICE_TIMES = 1;
        /**
         * 语音播放音量
         */
        static final int VOICE_VALUE = 100;
        /**
         * 语音播放男/女声
         */
        public static final String VOICE_GENDER = "ar-EG-Hoda&2";//1是男声，2是女声
        /**
         * 外语语音播放人声
         */
        public static final String VOICE_FL_TAG = "Halen&2";//女声Halen
        /**
         * 中文语音播放人声
         */
        public static final String VOICE_CN_TAG = "Sijia&2";//女声Sijia
        /**
         * 翻译完成自动语音播放
         */
        static final boolean VOICE_AUTO = false;

    }

    /**
     * 语音翻译已使用次数 (每日0点重置)
     */
    @Set(VOICE_USED_COUNT)
    void saveVoiceUsedCount(@KeyExtension String curDate, @Param int count);

    @Get(VOICE_USED_COUNT)
    int getVoiceUsedCount(@KeyExtension String curDate);


    /**
     * 文本翻译已使用次数 (每日0点重置)
     */
    @Set(TEXT_USED_COUNT)
    void saveTextUsedCount(@KeyExtension String curDate, @Param int count);

    @Get(TEXT_USED_COUNT)
    int getTextUsedCount(@KeyExtension String curDate);


    /**
     * 拍照翻译已使用次数 (每日0点重置)
     */
    @Set(PHOTO_USED_COUNT)
    void savePhotoUsedCount(@KeyExtension String curDate, @Param int count);

    @Get(PHOTO_USED_COUNT)
    int getPhotoUsedCount(@KeyExtension String curDate);


    /**
     * 保存强制收银台是否已显示 (每日0点重置)
     */
    @Set(CASHIER_FORCED_SHOWED)
    void saveCashierForced(@KeyExtension String curDate, @Param boolean show);

    @Get(value = CASHIER_FORCED_SHOWED, defaultBoolean = false)
    boolean isCashierForcedShowed(@KeyExtension String curDate);


    /**
     * 强制收银台显示后，翻译的次数 (每日0点重置)
     */
    @Set(TRANSLATE_AFTER_CASHIER_COUNT)
    void saveTranslateAfterCashierCount(@KeyExtension String curDate, @Param int count);

    @Get(TRANSLATE_AFTER_CASHIER_COUNT)
    int getTranslateAfterCashierCount(@KeyExtension String curDate);


    /**
     * 保存阿里Token
     */
    @Set(ALI_TOKEN)
    void saveAliToken(String aliToken);

    @Get(ALI_TOKEN)
    String getAliToken();


    /**
     * 保存语音播放速度
     */
    @Set(VOICE_SPEED)
    void saveVoiceSpeed(int speed);

    @Get(value = VOICE_SPEED, defaultInt = Default.VOICE_SPEED)
    int getVoiceSpeed();

    /**
     * 语音播放次数
     */
    @Set(VOICE_TIMES)
    void saveVoiceTimes(int times);

    @Get(value = VOICE_TIMES, defaultInt = Default.VOICE_TIMES)
    int getVoiceTimes();

    /**
     * 语音播放男/女声
     */
    @Set(VOICE_GENDER)
    void saveVoiceGender(String gender);

    @Get(value = VOICE_GENDER, defaultString = Default.VOICE_GENDER)
    String getVoiceGender();

    /**
     * 外语语音播放人声
     */
    @Set(VOICE_FL_TAG)
    void saveVoiceFLTag(String tag);

    @Get(value = VOICE_FL_TAG, defaultString = Default.VOICE_FL_TAG)
    String getVoiceFLTag();

    /**
     * 中文语音播放人声
     */
    @Set(VOICE_CN_TAG)
    void saveVoiceCNTag(String tag);

    @Get(value = VOICE_CN_TAG, defaultString = Default.VOICE_CN_TAG)
    String getVoiceCNTag();

    /**
     * 翻译完成自动语音播放
     */
    @Set(VOICE_AUTO)
    void saveVoiceAuto(boolean tag);

    @Get(value = VOICE_AUTO, defaultBoolean = Default.VOICE_AUTO)
    boolean getVoiceAuto();

    /**
     * 外语语音播放人声索引
     */
    @Set(VOICE_FL_TAG_INDEX)
    void saveVoiceFLTagIndex(int tag);

    @Get(value = VOICE_FL_TAG_INDEX, defaultInt = 0)
    int getVoiceFLTagIndex();

    /**
     * 中文语音播放人声索引
     */
    @Set(VOICE_CN_TAG_INDEX)
    void saveVoiceCNTagIndex(int tag);

    @Get(value = VOICE_CN_TAG_INDEX, defaultInt = 1)
    int getVoiceCNTagIndex();

    /**
     * 文本翻译目标语言
     */
    @Set(TRANS_TO_LANGUAGE)
    void saveTansToLanguage(String languageName);

    @Get(value = TRANS_TO_LANGUAGE, defaultString = "中文（简体）")
    String getTansToLanguage();

    /**
     * 文本翻译源语言
     */
    @Set(TRANS_FROM_LANGUAGE)
    void saveTansFromLanguage(String languageName);

    @Get(value = TRANS_FROM_LANGUAGE, defaultString = "英语")
    String getTansFromLanguage();

    /**
     * 拍照翻译目标语言
     */
    @Set(FILE_TO_LANGUAGE)
    void saveFileToLanguage(String languageName);

    @Get(value = FILE_TO_LANGUAGE, defaultString = "中文（简体）")
    String getFileToLanguage();
    /**
     * 拍照翻译源语言
     */
    @Set(FILE_FROM_LANGUAGE)
    void saveFileFromLanguage(String languageName);

    @Get(value = FILE_FROM_LANGUAGE, defaultString = "英语")
    String getFileFromLanguage();

    /**
     * 语音翻译目标语言
     */
    @Set(VOICE_TO_LANGUAGE)
    void saveVoiceToLanguage(String languageName);

    @Get(value = VOICE_TO_LANGUAGE, defaultString = "中文（简体）")
    String getVoiceToLanguage();

    /**
     * 语音翻译源语言
     */
    @Set(VOICE_FROM_LANGUAGE)
    void saveVoiceFromLanguage(String languageName);

    @Get(value = VOICE_FROM_LANGUAGE, defaultString = "英语")
    String getVoiceFromLanguage();

    /**
     * 文字识别源语言
     */
    @Set(WORD_TRANS_FROM_LANGUAGE)
    void saveWorTransFromLanguage(String languageName);

    @Get(value = WORD_TRANS_FROM_LANGUAGE, defaultString = "英语")
    String getWorTransFromLanguage();

    /**
     * 文字识别源语言
     */
    @Set(WORD_TRANS_TO_LANGUAGE)
    void saveWorTransToLanguage(String languageName);

    @Get(value = WORD_TRANS_TO_LANGUAGE, defaultString = "中文（简体）")
    String getWorTransToLanguage();

    /**
     * 取词翻译文本识别语言code
     */
    @Set(WORD_TRANS_CODE)
    void saveWorTransCode(String translateCode);

    @Get(value = WORD_TRANS_CODE, defaultString = "zh")
    String getWorTransCode();


    /**
     * 语音翻译使用次数
     */
    @Set(value = "VOICE_TRANSLATE_USE_COUNT")
    void saveVoiceTranslateUseCount(@Param int count);

    @Get(value = "VOICE_TRANSLATE_USE_COUNT",defaultInt = 0)
    int getVoiceTranslateUseCount();


    /**
     * 拍照翻译使用次数
     */
    @Set(value = "TAKE_PHOTO_USE_COUNT")
    void saveTakePhotoUseCount(@Param int count);

    @Get(value = "TAKE_PHOTO_USE_COUNT",defaultInt = 0)
    int getTakePhotoUseCount();


    /**
     * 同声传译使用次数
     */
    @Set(value = "SAME_VOICE_USE_COUNT")
    void saveSameVoiceUseCount(@Param int count);

    @Get(value = "SAME_VOICE_USE_COUNT",defaultInt = 0)
    int getSameVoiceUseCount();

    /**
     * 同生传译
     */
    @Set(value = "DOC_TRANSLATE_USE_COUNT")
    void saveDocTranslateUseCount(@Param int count);

    @Get(value = "DOC_TRANSLATE_USE_COUNT",defaultInt = 0)
    int getDocTranslateUseCount();



    @Set(value = "FUNC_FREE_COUNT")
    void saveFuncFreeCount(@Param int count);

    @Get(value = "FUNC_FREE_COUNT",defaultInt = 1)
    int getFuncFreeCount();

}
